<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * @author Anh Nguyen <duyanhnguyen@vccorp.vn>
 * @copyright 2012
 */

class List_group_model extends CI_Model
{

    public function getListGroup()
    {
        $return = array();
        $this->db->select("id, name");
        $this->db->from('list_group');
        $this->db->where(array(
            'delete_flag'    =>  '0'
        ));
        $rs = $this->db->get();
        if ($rs->num_rows() > 0) {
            $return = $rs->result_array();
            $rs->free_result();
            return $return;
        } else {
            $rs->free_result();
            return false;
        }
    }
    public function getDetail($id)
    {
    	$return = array();
    	$this->db->select("id, name");
    	$this->db->from('list_group');
    	$this->db->where(array(
    			'delete_flag'    =>  '0',
    			'id' => $id
    	));
    	$rs = $this->db->get();
    	if ($rs->num_rows() > 0) {
    		$return = $rs->result_array();
    		$rs->free_result();
    		return $return[0];
    	} else {
    		$rs->free_result();
    		return false;
    	}
    }
    

}

?>
